//构造方法
public class Person {
  public String name;
  public int age;

  public Person(){
      this("bit",9);                   //this(参数1,参数2) 调用的是2个参数的方法 this只能放在方法的第一行且方法不能形成环
      System.out.println("不带参数的构造方法...");
  }

  public Person(String name){
      this.name = name;
  }

  public Person(int age){
      this.age = age;
  }
  public Person(String name,int age){
      this.name = name;
      this.age = age;
      System.out.println("带有2个参数的构造方法被调用了");
  }

  public void show(){
      System.out.println("姓名: " + name + "年龄：" + age);
  }
    @Override                                //右键Generate -> tostring直接生成返回值
    public String toString() {
        return "Person{" + "name='" + name + '\'' + '}';
    }
}